package acm.蓝桥杯15;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.HashMap;
import java.util.Map;

public class 卡拉OK {
    public static void main(String[] args) {
        Reader sc=new Reader();
        int n = sc.nextInt();
        while (n-- > 0) {
            int m=sc.nextInt();
            int a[]=new int[m];
            int b[]=new int[m];
            for (int i = 0; i < m; i++) {
                a[i]=sc.nextInt();
            }
            for (int i = 0; i < m; i++) {
                b[i]=sc.nextInt();
            }
            System.out.println(solve(a,b));
        }
    }
    public static int solve(int a[],int b[]){
        Map<Integer,Integer> map=new HashMap<>();
        int n=a.length;
        int res=0;
        for (int i = 0; i < n; i++) {
            int key = a[i] - b[i];
            map.put(key,map.getOrDefault(key,0)+1);
        }
        for (Integer v : map.values()) {
            res=Math.max(res,v);
        }
        return res;
    }
    static class Reader {
        static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

        public static int nextInt() {
            try {
                in.nextToken();
            } catch (Exception ignored) {}
            return (int) in.nval;
        }
    }

}
